<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Sothink Scroller Widget </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
.button {
	height: 82px;
	line-height: 82px;
	background-image: url(bg-button.gif);
	width: 112px;
	font-size: 12px;
	font-weight: bold;
	text-align: center;
	cursor: pointer;
	float: left;
	font-family: Arial, Helvetica, sans-serif;
}
.txtcode {
	height: 82px;
	float: left;
	margin-right: 5px;
	width: 700px;
}
.iframeTitle,.scriptTitle {
	font-size: 14px;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #000000;
	clear: both;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #666666;
	width: 820px;
	padding-top: 10px;
	padding-bottom: 5px;
	margin-bottom: 10px;
}
.orTitle {
	font-size: 18px;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	clear: both;
	width: 50px;
	margin-top: 20px;
	line-height: 30px;
	background-color: #669900;
	text-align: center;
}
.scrollerView {
	text-align:left;
}
-->
</style>
</HEAD>

<BODY>
<div class="scrollerView">
<SCRIPT type="text/JavaScript">
<!--

var _GETS={};
_GETS["width"]=%d;
_GETS["height"]=%d;
_GETS["name"]="scroller.html";
_GETS["bdWid"]="%d";
_GETS["bgImg"]="";
_GETS["bgClr"]="%s";
_GETS["bdClr"]="%s";
_GETS["scrollbar"]=%d;

function _GetRequest(l)
{
		var s=l.substr(l.indexOf('?')+1);
		var as=s.split("&"),re=/([^=]*)=(.*)/,r;
		for(var i=0;i<as.length;i++)
		{
			r=re.exec(as[i]);
			if(r)
				_GETS[r[1]]=r[2];
		}
}

_GetRequest(location.href);
function copeIframeCode()
{
	var e;
	if(document.all)
		e=document.all("iframeCode");
	else
		e=document.getElementById("iframeCode");
	if(e)
		if(!copyToClipboard(e.value))
		{
			alert("Your browser does not support the function.\r\nPlease use Ctrl + C to copy.");
			e.select();
		}
		else
			alert("You've copied the code successfully.");
}

function copeScriptCode()
{
	var e;
	if(document.all)
		e=document.all("scriptCode");
	else
		e=document.getElementById("scriptCode");
	if(e)
		if(!copyToClipboard(e.value))
			{
				alert("Your browser does not support the function.\r\nPlease use Ctrl + C to copy.");
				e.select();
			}
		else
			alert("You've copied the code successfully.");			
}

function copyToClipboard(txt)
{
      if(window.clipboardData && document.all) 
      { 
			if(window.navigator.userAgent.toLowerCase().indexOf('windows 98') != -1)
      			return false;
      		try
      		{
              if(window.clipboardData.clearData())
              {
              	window.clipboardData.setData("Text", txt);
              	return true;
              }
            }
            catch(e){}
             
      }
	return false;
} 

document.write("<iframe  src=\""+"widget.html?"+
				"name="+_GETS["name"]+
				"&bgClr="+_GETS["bgClr"]+
				"&bdWid="+_GETS["bdWid"]+
				"&bdClr="+_GETS["bdClr"]+
				"&scrollbar="+_GETS["scrollbar"]+
				"&width="+_GETS["width"]+
				"&height="+_GETS["height"]+"\""+
				" width="+(_GETS["width"]+_GETS["bdWid"]*2)+
				" height="+(_GETS["height"]+_GETS["bdWid"]*2)+
				" frameborder=0 scrolling=no></iframe>");
//-->
</SCRIPT></div>
<p class="iframeTitle">Iframe code:</p>
<textarea rows=5 id="iframeCode" class="txtcode">
</textarea>
<div onclick='copeIframeCode()' class="button">Copy to clipboard</div>
<p class="orTitle">OR</p>
<p class="scriptTitle">Script code:</p>
<textarea rows=5 id="scriptCode" class="txtcode">
</textarea>
<div onclick='copeScriptCode()' class="button">Copy to clipboard</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function fsGetDIR(s)
{
	var t=s.toLowerCase();
	if(!t.indexOf("file:/") || !t.indexOf("http://") || !t.indexOf("https://"))
		return s.substr(0,s.lastIndexOf("/")+1);
	else return ""
}
dir=fsGetDIR(location.href);
if(document.all)
{
	fc=document.all("iframeCode");
	sc=document.all("scriptCode");
}
else
{
	fc=document.getElementById("iframeCode");
	sc=document.getElementById("scriptCode");
}
fc.value="<iframe  src=\""+dir+"widget.html?"+
				"name="+_GETS["name"]+
				"&bgClr="+_GETS["bgClr"]+
				"&bdWid="+_GETS["bdWid"]+
				"&bdClr="+_GETS["bdClr"]+
				"&scrollbar="+_GETS["scrollbar"]+
				"&width="+_GETS["width"]+
				"&height="+_GETS["height"]+"\""+
				" width="+(_GETS["width"]+_GETS["bdWid"]*2)+
				" height="+(_GETS["height"]+_GETS["bdWid"]*2)+
				" frameborder=0 scrolling=no></iframe>";
sc.value="<script src=\""+dir+"widget.js?"+
				"name="+_GETS["name"]+
				"&bgClr="+_GETS["bgClr"]+
				"&bdWid="+_GETS["bdWid"]+
				"&bdClr="+_GETS["bdClr"]+
				"&scrollbar="+_GETS["scrollbar"]+
				"&width="+_GETS["width"]+
				"&height="+_GETS["height"]+
				"\"></"+"script>";
//-->
</SCRIPT>
</BODY>
</HTML>
